import $api from '@/api'

// 1.5. 商品分类管理
// 1.5.1. 商品数据列表
export const getCateList = (data) => {
    return $api.get('categories', data)
}
export const getCate = (data) => {
    return $api.get('categories/' + data)
}
// 1.5.2. 添加分类
export const addCate = (data) => {
    return $api.post('categories', data)
}
export const submitParams = (data) => {
    return $api.post(`categories/${data.cateId}/attributes`, data)
}
// 1.5.3. 根据id查询分类
export const getTabClicked = (data) => {
    return $api.get(`categories/${data.cateId}/attributes`, data)
}
// 1.5.4. 编辑提交分类

export const editCate = (data) => {
    return $api.put('categories/' + data.cat_id, data)
}

export const editParams = (data) => {
    return $api.get(`categories/${data.cateId}/attributes/${data.attrId}`, data)
}
export const submitEditParams = (data) => {
    return $api.put(`categories/${data.cateId}/attributes/${data.attr_id}`, data)
}
// 1.5.5. 删除分类
export const removeCate = (data) => {
    return $api.del('categories/' + data)
}

export const delParams = (data) => {
    return $api.del(`categories/${data.cateId}/attributes/${data.attrId}`)
}


